#include <iostream>
#include <vector>
#include <unordered_map>
#include <algorithm>
using namespace std;
class Solution
{
public:
    vector<int> masterMind(string solution, string guess)
    {
        unordered_map<char, int> s, g;
        vector<int> ans(2, 0);
        for (int i = 0; i < solution.length(); ++i)
        {
            (solution[i] == guess[i]) ? ++ans[0] : (++s[solution[i]], ++g[guess[i]]);
        }
        ans[1] = min(s['R'], g['R']) + min(s['G'], g['G']) + min(s['B'], g['B']) + min(s['Y'], g['Y']);
        return ans;
    }
};
int main()
{
    Solution s;
    string solution = "YBBY", guess = "GYYB";
    vector<int> ans = s.masterMind(solution, guess);
    cout << ans[0] << " " << ans[1] << endl;
    system("pause");
    return 0;
}
